1. Field of the Invention
The present invention relates to a method and an apparatus for converting the number of colors by error diffusion, and for generating image data with good color by applying a color error diffusion process to select an appropriate color as an output color for each pixel.
2. Description of the Prior Art
A binary process such as an error diffusion method is used to output a halftone color image to a binary printer or to reduce data quantity when saving or transmitting image data.
As shown in FIG. 10, in a conventional image processing apparatus 80 utilizing the error diffusion method, a peripheral error giving portion 81 performs correction to input image data DI by distributing an error generated by the previous process. Corresponding to the corrected image data, an output color selection process portion 82 selects an appropriate color as an output color and outputs the selected color as output image data DO. An error calculation and memory portion 83 calculates an error between the image data inputted to the output color selection process portion 82 and the output color selected by the output color selection process portion 82 and memorizes the error. The selected output color is halftone data.
The peripheral error giving portion 81 gives an error that is calculated by a weight matrix with respect to an error generated in the pixel that was already processed and a position of the target pixel (this matrix is also called a diffusion matrix) to the input image data DI. The output color selection process portion 82 performs a binary process using a reference value.
In a usual error diffusion method, the input image data DI is continuous halftone data, and the output image data DO to be actually outputted is binary data. Using an error diffusion method, the color and the density of the input image data DI of the original image are maintained so that relatively faithful image can be reproduced. In addition, the binary process can compress the image data so that the amount of storage required for memorizing the output image data DO can be reduced. This image processing apparatus is disclosed in Japanese unexamined patent publication No. 9-307776, for example.
In the conventional binary process, concerning a full color image, the binary process is performed independently for each signal such as CMYK or RGB, which is dependent on an output device such as a printer or a display device. When the output or the display is performed, the signals or the outputs are composed so that a full color image is reproduced mimetically.
However, the calorimetric value of each output color depends on a device. In addition, when generating a halftone color using the same output apparatus, even if a dot incidence of each color CMYK is the same, the color can be seen different when the extents of overlaying are different. In a usual color error diffusion process, an input signal depending on a device is used, and a problem of dot overlaying in the same pixel is not controlled, so it is difficult to reproduce a desired color.
Therefore, a method of using a color vector for generating a halftone color by the error diffusion process is proposed (as disclosed in Japanese unexamined patent publication No. 9307776). In this method, the input image data are handled as a multidimensional quantity, though they are handled as a one-dimensional quantity in the conventional method. It is naturally possible to use a color signal depending on a device as a color signal handled as a vector. However, an input image expressed by a color space such as XYZ or CIELAB that does not depend on a device, an XYZ value of an outputtable color in an output apparatus that is previously known (there are eight colors, i.e., cyan, magenta, yellow, red, green, blue, white and black for binary value) and a CIELAB value (the calorimetric value of paper is usually used as a white color) are used for performing the halftone process below. Thus, it can be expected that the output color becomes the same as the input color in a colorimetric manner theoretically.
(1) The decision of the output color is performed by comparing an input color (vector) with a potential output color (vector) and by selecting the color in which the difference between the input color and the potential output color is the smallest. Namely, the color that is the closest to the input color in the color space is selected.
(2) An error between the input color and the output color generated in the color selection is calculated.
(3) For the next pixel to be processed, an error generated in the peripheral processed pixels is added with a weight to the input color so as to correct the input color, and the process (1) is performed again.
This method is called a vector error diffusion method and can easily support an increase of the outputtable colors due to a multistep halftone and an addition of a spot color.
In the conventional vector error diffusion, it is a standard of selection to select the color in which a sum of squares of difference in each element of the color vector is minimized in the process (1). This selection standard is always used for selecting the output color.
In order to generate a desired color in a halftone image, it is necessary to satisfy the condition that an average color in a certain area including plural pixels is substantially the same as a desired color. From this viewpoint, the rule in the conventional vector error diffusion process, i.e., the rule that “the color that is the closest to the input color in the color space is selected.” is effective.
However, in the conventional method, the color reproduction with good quality can be possible only in the ideal circumstance in which the dot of each pixel meets the rectangular area of the pixel correctly, and there is no overlap between the neighboring dots, no density inconsistency in the formed dot and no fluctuation of the dot position. Namely, if the conventional method is used for the actual color binary printer, it is difficult to achieve good color reproduction since each color area has its own color reproducibility.
In addition, the conventional method determines the output color of each pixel noting only the color vector and does not control the arrangement of the output color. Therefore, uneven dot arrangement can generate an undesired pattern of display.
Furthermore, as mentioned above, in the conventional method, an output color is selected by a single selection standard in which a sum of squares of difference is minimized. When this method is used in the actual color binary printer, it is difficult to achieve good color reproduction since each color area has its own color reproducibility. More specifically, there is a problem that a color saturation of a low chromatic or a monochromatic color becomes higher than a target value of the output.
In addition, in the above-mentioned conventional method, only a color is considered for determining a color of each pixel. Therefore, regardless of the color reproducibility, a dot that increases graininess in the visual image can be generated.
Namely, in the conventional vector error diffusion method, since the output color that simply minimizes a color error is selected, an undesired color pattern having a low frequency can be generated depending on the relationship between the target color and the position of the output color, resulting in a bad visual graininess.
In addition, if there are many kinds of outputtable colors, long hours are required for selecting a target output color, so it is necessary to perform the selection process simply.